//---------------------------------------------------------------------------

#ifndef ShipmentsH
#define ShipmentsH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <ToolWin.hpp>
#include <Db.hpp>
#include <DBTables.hpp>
#include <Buttons.hpp>

#include "ShipmentBridge.h"


//---------------------------------------------------------------------------
class TfrmShipments : public TForm
{
__published:	// IDE-managed Components
        TPanel *pnlMain;
        TLabel *lblName;
        TToolBar *barMain;
        TToolButton *btnUpdate;
        TToolButton *btnAdd;
        TToolButton *btnDelete;
        TStringGrid *grdShipments;
        TBitBtn *btnClose;
        TBitBtn *btnHelp;
        void __fastcall FormShow(TObject *Sender);
        void __fastcall btnAddClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall btnDeleteClick(TObject *Sender);
        void __fastcall grdShipmentsSelectCell(TObject *Sender, int ACol,
          int ARow, bool &CanSelect);
        void __fastcall btnUpdateClick(TObject *Sender);
        void __fastcall grdShipmentsKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall btnCloseClick(TObject *Sender);
private:
        TDatabase * dbMain;
        TShipmentBridge* bridge;
        TStringList * shipments;
        void SetButtonsState( int row);
        void RefreshGrid();

public:		
        __fastcall TfrmShipments(TComponent* Owner, TDatabase * dbMain);
};
//---------------------------------------------------------------------------
#endif
